import demjson

if __name__ == '__main__':
    with open("col2row.txt", mode='r+', encoding='utf8') as f:
        line = f.readline()

        tb = list()
        tb.append(list())
        tb.append(list())
        while line:
            tb[0].append(line.split("\t")[0])
            tb[1].append(line.split("\t")[1].replace("\n",""))
            line = f.readline()

        f.seek(0)
        f.truncate()
        f.write(demjson.encode(tb[0]))
        f.write("\n")
        f.write(demjson.encode(tb[1]))
    f.close()
